// AI清单服务接口
import { get, post, put, del } from './api';
import { AiPapersItem, QueryParams } from '../pages/ai_papers/models/AiPapersModels';

// API响应类型
interface ApiResponse<T> {
  code: number;
  message: string;
  data: T;
}


// 获取AI清单列表
export async function getAiPapers(params: QueryParams) {
  return get<ApiResponse<AiPapersItem[]>>('/aipapers');
}

// 添加AI清单项
export async function addAiPapers(AiPapersItem: Partial<AiPapersItem>) {
  return post<ApiResponse<AiPapersItem>>('/aipapers',AiPapersItem);
}

// 更新AI清单项
export async function updateAiPapers(id: number, data: Partial<AiPapersItem>) {
  return put<ApiResponse<AiPapersItem>>(`/aipapers/${id}`, data);
}

// 获取AI清单详情
export async function getAiPapersDetail(id: number) {
  return get<ApiResponse<AiPapersItem>>(`/aipapers/${id}`);
} 